import { expect } from "chai";
import { Log } from "ethers";
import { ethers } from "hardhat";

export function initialize(): void {
    it("1.1 合约基本信息-权限-版权-初始化", async function () {
      const defaultAdmin = "0x1234567890123456789012345678901234567890";
      const name = "Crypto leo";
      const symbol = "LEO";
      const contractURI = "ipfs://QmYwdgYorLDquXZTvmiJJHLxcgA6BDZs3WXrCprgGcd4at";
      const trustedForwarders = ["0xC9D994e2E2614bE1218AfB55104723C2c2B8AA13"];
      const saleRecipient = "0xC9D994e2E2614bE1218AfB55104723C2c2B8AA13";
      const royaltyRecipient = "0xC9D994e2E2614bE1218AfB55104723C2c2B8AA13";
      const royaltyBps = 1000;
      const platformFeeBps = 500;
      const platformFeeRecipient = "0xC9D994e2E2614bE1218AfB55104723C2c2B8AA13";

      const contract = this.dropERC721

   


      console.log("Symbol告诉我合约的:", await contract.symbol());
      // expect(await contract.defaultAdmin()).to.equal(defaultAdmin);
      expect(await contract.name()).to.equal(name);
      expect(await contract.symbol()).to.equal(symbol);
      expect(await contract.contractURI()).to.equal(contractURI);
      expect(await contract.trustedForwarders(0)).to.equal(trustedForwarders[0]);
      expect(await contract.saleRecipient()).to.equal(saleRecipient);
      expect(await contract.royaltyRecipient()).to.equal(royaltyRecipient);
      expect(await contract.royaltyBps()).to.equal(royaltyBps);
      expect(await contract.platformFeeBps()).to.equal(platformFeeBps);
      expect(await contract.platformFeeRecipient()).to.equal(platformFeeRecipient);
      expect(await contract.transferRole()).to.equal(ethers.keccak256("TRANSFER_ROLE"));
      expect(await contract.minterRole()).to.equal(ethers.keccak256("MINTER_ROLE"));
      expect(await contract.metadataRole()).to.equal(ethers.keccak256("METADATA_ROLE"));     
    }
    )
}

export function shouldBehaveUintErc721(): void {
    // it("Should create a post", async function () {
    //     const blogTitle = "My first post"
    //     const contentHash = await this.blog.getRandomBytes32("12345")

    //     await this.blog.createPost(blogTitle, contentHash)
    
    //     const posts = await this.blog.fetchPosts()
    
    //     //this is the first post, so it is posts[0]
    //     expect(posts[0].title).to.equal(blogTitle)
    //     expect(posts[0].contentHash).to.equal(contentHash)
    //     // expect(posts[0].id).to.equal(contentHash)
    //   })  

}